<?php


namespace app\miniProgram\validate;


use think\Validate;

class Action extends Validate
{
    protected $rule =   [
        'id' => 'require',
        'username' => 'require',
        'password' => 'require',
        'mdId' => 'require',
        'bar_code' => 'require',
        'type' => 'require',
        'num' => 'require',
        'wId' => 'require',
        'phone' => 'require',
        'cId' => 'require',

        'correlation_order' => 'require',
        'material_dossier_id' => 'require',
        'craft_detail_id' => 'require',
        'pricing_mode' => 'require',
        'u_g_id' => 'require',
        'qualifiedNum' => 'require',
        'passNum' => 'require',
        'wasteNum' => 'require',
        'orderId' => 'require',
        'detailId' => 'require',


    ];
    // 验证提示
    protected $message  =   [
        'id.require'    => '参数不能为空',
        'username.require'    => '参数不能为空',
        'password.require'    => '参数不能为空',
        'mdId.require'    => '参数不能为空',
        'bar_code.require'    => '参数不能为空',
        'type.require'    => '参数不能为空',
        'num.require'    => '参数不能为空',
        'wId.require'    => '参数不能为空',
        'phone.require'    => '参数不能为空',
        'correlation_order.require'    => '参数不能为空',
        'material_dossier_id.require'    => '参数不能为空',
        'craft_detail_id.require'    => '参数不能为空',
        'pricing_mode.require'    => '参数不能为空',
        'u_g_id.require'    => '参数不能为空',
        'qualifiedNum.require'    => '参数不能为空',
        'passNum.require'    => '参数不能为空',
        'wasteNum.require'    => '参数不能为空',
        'cId.require'    => '参数不能为空',
        'detailId.require'    => '参数不能为空',
        'orderId.require'    => '参数不能为空',

    ];
    // 应用场景
    protected $scene = [
        "login" => ["phone","cId"],//登录
        "getKucun" => ["mdId","bar_code"],//获取库存
        "sureInReceipt" => ["mdId","wId",'type','num'],//入库
        "sureOutReceipt" => ["mdId","wId",'type','num'],//出库
        'processReport' => ['correlation_order', 'material_dossier_id', 'craft_detail_id',
            'pricing_mode', 'u_g_id',  'qualifiedNum',
            'passNum', 'wasteNum'],//报工
        'pandian'=>['wId','mdId','num','backNum'],//盘点
        'editPd'=>['detailId','orderId','num'],//盘点
    ];
}